<div class="container">
  <div class="primary-content blog">
    <div class="blog-post">

	<h1 class="blog-post-title"><a href="<%= article_path(@commentable) %>"><%= @commentable.title %></a></h1>

	<h2 class="label">标签:
	<% @commentable.tags.each do |tag| %>
	    <%= link_to tag.name, tag_path(tag) %>
	<% end %>
	</h2>
    
    <div class="article-body"> 
	<p><%= markdown @commentable.body %><p>
	</div>

	
	<div>

	<%= link_to "<< Back to Articles List", articles_path %>

	<% if logged_in? %>

	<%= link_to "Delete", article_path(@commentable), method: :delete, :confirm => "Really delete the article" %>

	<%= link_to "edit", edit_article_path(@commentable) %>

	<% end %>

	</div>

	</div>

	<div class="comments">

	<h2 class="comment-number">回复(<%= @commentable.comments.size %>)</h2>

	<%= render partial: "comments/comment", locals: { post: @commentable }, collection: @commentable.comments %>

	<div class="bubble">

	<%= render template: "comments/new" %>

	</div>
  </div>
</div>
<% content_for :template_js do %>
<script>
    $("textarea#comment_body").keydown(function(e) {
      if (e.ctrlKey && e.keyCode == 13) {
        $("input[type=submit]").click();
      }
    });
</script>
<% end %>